package com.seiya.cookit;

import android.os.Bundle;
import android.app.Activity;
import android.content.Intent;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;

public class RecetasActivity extends Activity {

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_recetas);
        
        Button ensaladas = (Button) findViewById(R.id.bt_recetensalada);
		ensaladas.setOnClickListener(new OnClickListener() {
			
			@Override
			public void onClick(View v) {
				Intent intencion = new Intent(getBaseContext(), RecetasEnsaladasActivity.class);
				startActivity(intencion);
			}
		});
		
		Button segundos = (Button) findViewById(R.id.bt_recetsegundo);
		segundos.setOnClickListener(new OnClickListener() {
			
			@Override
			public void onClick(View v) {
				Intent intencion = new Intent(getBaseContext(), RecetasSegundosActivity.class);
				startActivity(intencion);
			}
		});
		
		Button sopas = (Button) findViewById(R.id.bt_recetsopa);
		sopas.setOnClickListener(new OnClickListener() {
			
			@Override
			public void onClick(View v) {
				Intent intencion = new Intent(getBaseContext(), RecetasSopasActivity.class);
				startActivity(intencion);
			}
		});
		
		Button postres = (Button) findViewById(R.id.bt_recetpostre);
		postres.setOnClickListener(new OnClickListener() {
			
			@Override
			public void onClick(View v) {
				Intent intencion = new Intent(getBaseContext(), RecetasPostresActivity.class);
				startActivity(intencion);
			}
		});
		
		Button bebidas = (Button) findViewById(R.id.bt_recetbebida);
		bebidas.setOnClickListener(new OnClickListener() {
			
			@Override
			public void onClick(View v) {
				Intent intencion = new Intent(getBaseContext(), RecetasBebidasActivity.class);
				startActivity(intencion);
			}
		});
    }

    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        getMenuInflater().inflate(R.menu.menu, menu);
        return true;
    }
    
    @Override
    public boolean onOptionsItemSelected(MenuItem item) {
    	switch (item.getItemId()) {
		case R.id.menu_inicio:
			Intent intencion = new Intent(getBaseContext(), MainActivity.class);
			startActivity(intencion);
			break;
		case R.id.menu_glosario:
			Intent intencion2 = new Intent(getBaseContext(), GlosarioActivity.class);
			startActivity(intencion2);
			break;
		case R.id.menu_mrecetas:
			Intent intencion3 = new Intent(getBaseContext(), LoginActivity.class);
			startActivity(intencion3);
			break;
		case R.id.menu_recetas:
			Intent intencion4 = new Intent(getBaseContext(), RecetasActivity.class);
			startActivity(intencion4);
			break;
		default:
			break;
		}
    	return false;
    }
}
